// 学院类型定义
export interface College {
  id: number;
  name: string;
  dean: string;
  location: string;
  contactNumber: string;
  description: string;
  departmentCount: number;
  studentCount: number;
  teacherCount: number;
  establishedYear: string;
  createdAt: string;
  updatedAt: string;
}

// Mock 学院数据
export const mockColleges: College[] = [
  {
    id: 1,
    name: "计算机科学与技术学院",
    dean: "张教授",
    location: "主教学楼A栋",
    contactNumber: "021-12345678",
    description: "专注于计算机科学与技术领域的教学与研究",
    departmentCount: 5,
    studentCount: 1200,
    teacherCount: 85,
    establishedYear: "2000",
    createdAt: new Date('2023-01-15').toISOString(),
    updatedAt: new Date('2023-01-15').toISOString()
  },
  {
    id: 2,
    name: "人工智能学院",
    dean: "李教授",
    location: "主教学楼B栋",
    contactNumber: "021-12345679",
    description: "致力于人工智能领域的创新研究",
    departmentCount: 4,
    studentCount: 950,
    teacherCount: 70,
    establishedYear: "1998",
    createdAt: new Date('2023-01-15').toISOString(),
    updatedAt: new Date('2023-01-15').toISOString()
  },
  {
    id: 3,
    name: "鸿蒙学院",

    dean: "王教授",
    location: "文科楼C栋",
    contactNumber: "021-12345680",
    description: "培养具有国际视野的商业管理人才",
    departmentCount: 6,
    studentCount: 1500,
    teacherCount: 100,
    establishedYear: "1995",
    createdAt: new Date('2023-01-15').toISOString(),
    updatedAt: new Date('2023-01-15').toISOString()
  }
];

// 数据管理器类用于通知数据更新
export class DashboardDataManager {
  // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
  private listeners: Function[] = [];

  // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
  addListener(listener: Function): void {
    this.listeners.push(listener);
  }

  // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
  removeListener(listener: Function): void {
    this.listeners = this.listeners.filter(l => l !== listener);
  }

  notifyListeners(): void {
    this.listeners.forEach(listener => listener());
  }
}

// 导出单例实例
export const dashboardDataManager = new DashboardDataManager();